package com.androidhuman.example.layoutsample;

import android.app.Activity;
import android.os.Bundle;

public class LayoutPreview extends Activity {

	int resId;
	
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
	    super.onCreate(savedInstanceState);
        resId = getIntent().getIntExtra("layout_id", -1);
        if(resId==-1)
        	throw new IllegalStateException();
        setContentView(resId);
        
        switch(resId){
        case R.layout.linear:
        	setTitle("LinearLayout");
        	break;
        	
        case R.layout.relative:
        	setTitle("RelativeLayout");
        	break;

        case R.layout.frame:
        	setTitle("FrameLayout");
        	break;
        	
        case R.layout.table:
        	setTitle("TableLayout");
        	break;
        	
        case R.layout.scroll:
        	setTitle("ScrollLayout");
        	break;
        	
        }
        
	}

}
